﻿namespace SampleSite.admin.ajax.grid
{
    using GenericHtml;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using WLFramework.Json;

    /// <summary>
    /// getAllApps 的摘要说明
    /// </summary>
    public class getAllApps : AjaxHttpHandler
    {
        public override void OnProcessRequest(HttpContext context)
        {
            using (PermissionContext db = new PermissionContext())
            {
                var query = from p in db.sys_Applications
                            where p.A_State != 2
                            select new
                            {
                                id = p.A_ID,
                                name = p.A_CName,
                                url = p.A_AppUrl,
                                description = p.A_AppDescription,
                                state = p.A_State,
                            };

                context.Response.Write(JSON.Instance.ToJSON(query.ToList()));
            }
        }
    }
}